package com.janwen.j2se.thread;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ThreadJoin implements Runnable {

	
	static final Log logger = LogFactory.getLog(ThreadJoin.class);
	static int i = 0;
	@Override
	public void run() {
		for(int j=0;j<5;j++){
			i++;
		}
	}
	
	
	
	public static void main(String[] args) throws InterruptedException {
		ThreadJoin tj  = new ThreadJoin();
		Thread t = new Thread(tj);
		t.start();
		//不调用join方法,不一定输出5
		t.join(100);
		logger.info(i);
	}

}
